home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / MAGS.ZIP / VLAD#3.ZIP / ARTICLE.3_1 < prev    next >
Encoding:
Text File  |  1995-02-06  |  2.4 KB  |  72 lines

  1.  
  2. ; Thunderbyte Residency Test, by Rhincewind [Vlad]
  3. ;
  4. ; As you may or may not know, the Thunderbyte resident av utilities hook
  5. ; themselves to the device driver chain using the following device names:
  6. ; TBDRVXXX, TBFILXXX, TBDSKXXX, TBMEMXXX, TBCHKXXX and TBLOGXXX.
  7. ; Now, by doing trial handle opens you can detect if those devices do or 
  8. ; do not exist et voila, you have a method for testing residency. TBAV 
  9. ; itself scans the actual device driver chain for the TB???XXX devices 
  10. ; which is unlike this method, pretty much impossible to confuse, but also 
  11. ; undocumented and thus it's not guaranteed to work under future versions 
  12. ; of DOS! Yes, Frans Veldman calls vile and unsafe functions in his battle 
  13. ; against replicating codefragments.
  14. ;
  15. ; Added note: Just recently I was looking at the EMM virus written by
  16. ; the author of the OneHalf family and found that it traces the device
  17. ; chain to detect thunderbyte residency. This means that this kind of
  18. ; detection isn't exactly new. Oh well, what the heck.
  19.  
  20.                 .model tiny
  21.  
  22.                 .code
  23.  
  24.                 org 100h
  25.  
  26. start:
  27.                 mov ah, 09
  28.                 mov dx, offset startmsg
  29.                 int 21h
  30.                 mov cx,6
  31.                 mov dx, offset tbdrvxxx
  32. detect_loop:                
  33.                 mov ah,09
  34.                 int 21h
  35.                 mov ax, 3d00h
  36.                 add dx,9
  37.                 int 21h
  38.                 push dx
  39.                 mov dx, offset not_resident
  40.                 jc dont_add
  41.                 add dx, (resident-not_resident)
  42.                 mov bh,3eh
  43.                 xchg ax,bx
  44.                 int 21h
  45. dont_add:
  46.                 mov ah, 09
  47.                 int 21h
  48.                 pop dx
  49.                 add dx,9
  50.                 loop detect_loop
  51.                 int 20h
  52. startmsg        db 'Thunderbyte Residency Test by Rhincewind [Vlad]'
  53.                 db 0dh,0ah,0dh,0ah,'$'
  54. tbdrvxxx        db 'TbDriver$'
  55.                 db 'TBDRVXXX',0
  56. tbfilxxx        db 'TbFile$',0,0
  57.                 db 'TBFILXXX',0
  58. tbdskxxx        db 'TbDisk$',0,0
  59.                 db 'TBDSKXXX',0
  60. tbmemxxx        db 'TbMem$',0,0,0
  61.                 db 'TBMEMXXX',0
  62. tbchkxxx        db 'TbCheck$',0
  63.                 db 'TBCHKXXX',0
  64. tblogxxx        db 'TbLog$',0,0,0
  65.                 db 'TBLOGXXX',0
  66. not_resident    db ' - Not Resident',0dh,0ah,'$'
  67. resident        db ' - Resident',0dh,0ah,'$'
  68.  
  69.                 end start
  70.  
  71.  
  72.